Skip to content

fix: add specific error message for plain permalink sites#25703

Open
mmustafasenoglu wants to merge 1 commit into
wordpress-mobile:trunkfrom
mmustafasenoglu:fix/plain-permalink-error-message
Open

fix: add specific error message for plain permalink sites#25703
mmustafasenoglu wants to merge 1 commit into
wordpress-mobile:trunkfrom
mmustafasenoglu:fix/plain-permalink-error-message

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Summary

When a self-hosted WordPress site uses plain permalinks, the REST API root is advertised as a query-parameter form (rest_route=/) which causes the login to fail with a generic error message.

Before: "Cannot load the WordPress site details"
After: "This site uses plain permalinks, which are not fully supported. Please enable pretty permalinks in Settings > Permalinks, or contact your hosting provider for assistance."

Changes

  • Added new SignInError.plainPermalinkNotSupported case with a specific, actionable error message
  • Added detection of rest_route query parameter in the API root URL
  • When site details loading fails and the API root uses rest_route form, the specific error is shown instead of the generic one

Files Changed

  • WordPress/Classes/Login/SelfHostedSiteAuthenticator.swift

Related Issues

When a self-hosted WordPress site uses plain permalinks, the REST API
root is advertised as a query-parameter form (rest_route=/) which can
cause login failures. This change detects this case and shows a specific,
actionable error message directing users to enable pretty permalinks.

Before: "Cannot load the WordPress site details"
After: "This site uses plain permalinks, which are not fully supported.
        Please enable pretty permalinks in Settings > Permalinks, or
        contact your hosting provider for assistance."

Fixes wordpress-mobile#25604

Signed-off-by: mustafasenoglu <mustafasenoglu@users.noreply.github.com>
@crazytonyli

Copy link
Copy Markdown
Contributor

Thanks for the pull request. I'd prefer to support those sites properly, once Automattic/wordpress-rs#1369 lands. /cc @jkmassel

@mmustafasenoglu

Copy link
Copy Markdown
Author

Thanks for the update @crazytonyli. Makes sense to wait for wordpress-rs#1369 to land first. I'll keep an eye on that and can revisit this PR once it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-hosted login: "Cannot load the WordPress site details" on plain-permalink sites; error surfaces no underlying reason

2 participants